'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const {
    router,
    controller,
    jwt
  } = app;
  // 获取token
  router.post('/login', controller.login.login);
  // 登录
  router.post('/get_info', jwt, controller.login.getInfo);
  // 获取七牛token
  router.post('/get_token', jwt, controller.qnToken.qnToken);
  // 装修列表
  router.post('/history_list', jwt, controller.fitment.historyList);
  // 获取装修
  router.post('/get_fitment', jwt, controller.fitment.getFitment);
  // 上线装修
  router.post('/set_fitment', jwt, controller.fitment.setFitment);
  // 管理员列表
  router.post('/admin_list', jwt, controller.admin.adminList);
  // 操作管理员
  router.post('/admin_operation', jwt, controller.admin.adminOperation);
  router.post('/apply_list', jwt, controller.apply.applyList);

  router.post('/classify_list', jwt, controller.news.classifyList);
  router.post('/handle_classify', jwt, controller.news.handleClassify);
  router.post('/news_list', jwt, controller.news.newsList);
  router.post('/handle_news', jwt, controller.news.handleNews);

};